package proxy.staticProxy;

public class MyServiceStaticProxy implements MyService {

    private MyService myService;

    public MyServiceStaticProxy(MyService myService) {
        this.myService = myService;
    }

    @Override
    public void m1() {
        long startTime = System.currentTimeMillis();
        myService.m1();
        long endTime = System.currentTimeMillis();
        System.out.println("运行时长：" + (endTime - startTime) + "ms");
    }

    @Override
    public String m2() {
        long startTime = System.currentTimeMillis();
        String returnStr = myService.m2();
        long endTime = System.currentTimeMillis();
        System.out.println("运行时长：" + (endTime - startTime) + "ms");
        return returnStr;
    }
}
